package com.alan.designMode.builder;

import java.util.ArrayList;

/**
 * 导演类
 * Created by Alan on 17-8-28
 */
public class Director {

    private ArrayList<String> sequence = new ArrayList<>();

    private BenzBuilder benzBuilder = new BenzBuilder();

    private BMWBuilder bmwBuilder = new BMWBuilder();


    public BenzModel getABenzMOdel(){
        //清理场景，
        this.sequence.clear();
        //定义顺序
        this.sequence.add("start");
        this.sequence.add("stop");
        //按照顺序返回模型车
        this.benzBuilder.setSequence(sequence);
        return (BenzModel) this.benzBuilder.getCarModel();
    }

    public BenzModel getBBenzMOdel(){
        //
        this.sequence.clear();
        this.sequence.add("engineboom");
        this.sequence.add("start");
        this.sequence.add("stop");
        this.benzBuilder.setSequence(sequence);
        return (BenzModel) this.benzBuilder.getCarModel();
    }

    public BMWModel getCBMWModel(){
        this.sequence.clear();
        this.sequence.add("alarm");
        this.sequence.add("start");
        this.sequence.add("stop");
        this.bmwBuilder.setSequence(sequence);
        return (BMWModel) this.bmwBuilder.getCarModel();
    }

    public BMWModel getDBMWModel(){
        this.sequence.clear();
        this.sequence.add("start");
        this.bmwBuilder.setSequence(sequence);
        return (BMWModel) this.bmwBuilder.getCarModel();
    }

    /**
     * 这里还能加若干方法
     */


}
